package datastructures;

public class WorkUnit {

	private int[] requiredTrials;
	private double[] power_distribution;
	private int[] coordinates;
	private long exhaustiveCombinations;
	private double worstExpectedCombinations;
	
	public WorkUnit (int[] trials_per_k, double[] power_per_k, int[] coordinates, long exhaustiveCombinations, double worstCaseCombinations) {
		this.requiredTrials = trials_per_k; 
		this.power_distribution = power_per_k;
		this.coordinates = coordinates;
		this.exhaustiveCombinations = exhaustiveCombinations;
		this.worstExpectedCombinations = worstCaseCombinations;
	}
	

	public long getBruteForceCombinationsInRegion() {
		return exhaustiveCombinations; 
	}
	
	public double getWorstExpectedCombinationsFromRegion() {
		return worstExpectedCombinations;
	}
	
 	public int[] getRequiredTrials() {
		return requiredTrials;
	}
 	
 	public double[] getPowerDistribution() {
 		return power_distribution;
 	}
 	
 	public void setRequiredTrials(int[] trial_spectrum) {
		requiredTrials = trial_spectrum;
	}
 	
 	public int getTotalRequiredTrials() {
 		int total_trials = 0;
 		for(int k=0; k<requiredTrials.length; k++)
			total_trials += requiredTrials[k];	
		return total_trials;
 	}
 	
	public int[] getCoordinates() {
		return coordinates;
	}
	
	
	public String toStringBrief() {
		StringBuffer temp = new StringBuffer("[" + coordinates[0]);
		
		for(int box=1; box<coordinates.length; box++) {
			int window = coordinates[box];
			temp.append(" x "+window);
		}
		temp.append("]");		
	
		return temp.toString();		
	}

	public String toStringExtended() {
		return null;
	}
	
}
